local t = Def.ActorFrame {};
t[#t+1] = LoadActor("_P2chartelements") .. { 
	InitCommand=function(self) self:horizalign(center):addy(-15):x(-65):zoom(0.6) end;
};


t[#t+1] = LoadFont("_pixellari 32px") .. { -- Tap count
		  InitCommand=cmd(horizalign,right;zoom,0.75;addx,50;addy,-43);
		  OnCommand=cmd(queuecommand,"Transition";);
          CurrentStepsP2ChangedMessageCommand=cmd(finishtweening;queuecommand,"Set";); 
		  CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		  TransitionCommand=cmd(diffusealpha,0;addy,-3;smooth,0.2;diffusealpha,1;addy,3;);
		  PlayerJoinedMessageCommand=cmd(queuecommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;);
          ChangedLanguageDisplayMessageCommand=cmd(queuecommand,"Set"); 
          SetCommand=function(self)
			stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2)
			local song = GAMESTATE:GetCurrentSong();
			if song then 
				if stepsP2 ~= nil then
					local GetP2Radar = GAMESTATE:GetCurrentSteps(PLAYER_2):GetRadarValues(PLAYER_2);
					local P2Taps = GetP2Radar:GetValue('RadarCategory_TapsAndHolds')+GetP2Radar:GetValue('RadarCategory_Jumps')+GetP2Radar:GetValue('RadarCategory_Hands');
					self:settext(P2Taps);
				else
					self:settext("0")
				end
			else
				self:settext("-")
			end
         end
};

t[#t+1] = LoadFont("_pixellari 32px") .. { -- Hold count
		  InitCommand=cmd(horizalign,right;zoom,0.75;addx,50;addy,-25);
		  OnCommand=cmd(queuecommand,"Transition";);
          CurrentStepsP2ChangedMessageCommand=cmd(finishtweening;queuecommand,"Set";); 
		  CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		  TransitionCommand=cmd(diffusealpha,0;addy,-3;smooth,0.2;diffusealpha,1;addy,3;);
		  PlayerJoinedMessageCommand=cmd(queuecommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;);
          ChangedLanguageDisplayMessageCommand=cmd(queuecommand,"Set"); 
          SetCommand=function(self)
			stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2)
			local song = GAMESTATE:GetCurrentSong();
			if song then 
				if stepsP2 ~= nil then
					local GetP2Radar = GAMESTATE:GetCurrentSteps(PLAYER_2):GetRadarValues(PLAYER_2);
					local P2Holds = GetP2Radar:GetValue('RadarCategory_Holds');
					self:settext(P2Holds);
				else
					self:settext("0")
				end
			else
				self:settext("-")
			end
         end
};

t[#t+1] = LoadFont("_pixellari 32px") .. { -- Jump count
		  InitCommand=cmd(horizalign,right;zoom,0.75;addx,50;addy,-7);
		  OnCommand=cmd(queuecommand,"Transition";);
          CurrentStepsP2ChangedMessageCommand=cmd(finishtweening;queuecommand,"Set";); 
		  CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		  TransitionCommand=cmd(diffusealpha,0;addy,-3;smooth,0.2;diffusealpha,1;addy,3;);
		  PlayerJoinedMessageCommand=cmd(queuecommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;);
          ChangedLanguageDisplayMessageCommand=cmd(queuecommand,"Set"); 
          SetCommand=function(self)
			stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2)
			local song = GAMESTATE:GetCurrentSong();
			if song then 
				if stepsP2 ~= nil then
					local GetP2Radar = GAMESTATE:GetCurrentSteps(PLAYER_2):GetRadarValues(PLAYER_2);
					local P2Jumps = GetP2Radar:GetValue('RadarCategory_Jumps');
					self:settext(P2Jumps);
				else
					self:settext("0")
				end
			else
				self:settext("-")
			end
         end
};

t[#t+1] = LoadFont("_pixellari 32px") .. { -- Mine count
		  InitCommand=cmd(horizalign,right;zoom,0.75;addx,50;addy,11);
		  OnCommand=cmd(queuecommand,"Transition";);
          CurrentStepsP2ChangedMessageCommand=cmd(finishtweening;queuecommand,"Set";); 
		  CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		  TransitionCommand=cmd(diffusealpha,0;addy,-3;smooth,0.2;diffusealpha,1;addy,3;);
		  PlayerJoinedMessageCommand=cmd(queuecommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;);
          ChangedLanguageDisplayMessageCommand=cmd(queuecommand,"Set"); 
          SetCommand=function(self)
			stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2)
			local song = GAMESTATE:GetCurrentSong();
			if song then 
				if stepsP2 ~= nil then
					local GetP2Radar = GAMESTATE:GetCurrentSteps(PLAYER_2):GetRadarValues(PLAYER_2);
					local P2Mines = GetP2Radar:GetValue('RadarCategory_Mines');
					self:settext(P2Mines);
				else
					self:settext("0")
				end
			else
				self:settext("-")
			end
         end
};

t[#t+1] = LoadFont("_pixellari 32px") .. { -- Score
		  InitCommand=cmd(x,-25;y,40;diffuse,ColorLightTone( PlayerColor(PLAYER_2) );strokecolor,(color("#000000")););
		  OnCommand=cmd(horizalign,center;zoom,0.8);
		  OffCommand=cmd(decelerate,0.2;zoomy,0);
		  CurrentSongChangedMessageCommand=cmd(finishtweening;playcommand,"Set");
		  CurrentCourseChangedMessageCommand=cmd(finishtweening;playcommand,"Set");
		  CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set";playcommand,"Transition");
		  TransitionCommand=cmd(finishtweening;playcommand,"Set");
		  PlayerJoinedMessageCommand=cmd(queuecommand,"Set";diffusealpha,0;smooth,0.3;diffusealpha,1;);
          	  ChangedLanguageDisplayMessageCommand=cmd(queuecommand,"Set");
          	  SetCommand=function(self)
      		 local steps = GAMESTATE:GetCurrentSteps(PLAYER_2);
		 local song = GAMESTATE:GetCurrentSong();
			if song then
				if steps ~= nil then
					local score = PROFILEMAN:GetProfile(PLAYER_2):GetHighScoreList(song,steps):GetHighScores();
					local getscore = score[1]	
						if getscore then
							local P2score = getscore:GetScore();				
							self:smooth(0.2);
							self:diffusealpha(0);
							self:addx(10);
							self:settextf(" %s ", P2score);
							self:playcommand("Refresh");
							self:stoptweening():diffusealpha(0):smooth(0.2):diffusealpha(1);
						else
							self:smooth(0.2):diffusealpha(0):addx(10);							
							self:settext(" UNPLAYED ");
							self:visible(GAMESTATE:IsHumanPlayer(PLAYER_2));
							self:stoptweening():diffusealpha(0):smooth(0.2):diffusealpha(1);							
						end
				else
					self:smooth(0.2):diffusealpha(0):addx(10);					
					self:settext("");
					self:playcommand("Refresh");
					self:visible(GAMESTATE:IsHumanPlayer(PLAYER_2));
					self:stoptweening():diffusealpha(0):smooth(0.2):diffusealpha(1);
                end
			else
				self:settext(" --- ");
			end
		end	
};

return t